﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 学生选课及成绩查询管理系统
{
    public partial class showStudentPersonalCourseTableInfo : Form
    {
        public showStudentPersonalCourseTableInfo()
        {
            InitializeComponent();
        }
        User user;

        internal User User
        {
            get { return user; }
            set { user = value; }
        }
        private void showStudentPersonalCourseTableInfo_Load(object sender, EventArgs e)
        {
            string sql = "select s.stuname as '学生姓名',c.cname as '课程名',c.credit as '学分',cproperties as '课程性质',t.tname as '教师名' from student s"+
            " join grade g on s.stuno=g.stuno join course c on c.cno=g.cno"+
            " join teacher t on t.tno=c.tno where cstate=1 and s.stuno="+user.Username;
            DataTable dt =DBAccess.GetTable(sql);
            dataGridView1.DataSource = dt;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
